import PersonInfo from '@/views/PersonInfo.vue'
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import PersonLot from '@/views/PersonLot.vue'
import PersonCar from '@/views/PersonCar.vue'
import PcommodityList from '@/views/PcommodityList.vue'
import commodityPayment from '@/components/personal/commodityPayment.vue'


//yang
import loginWx from '@/components/header/loginWx.vue'
import passwdRet from '@/components/header/passwdRet.vue'
import personData from '@/components/personData.vue'
import serectCode from '@/components/serectCode.vue'
import phoneMessage from '@/components/header/phoneMessage.vue'
import personzl from '@/components/header/personzL.vue'
import loginRlist from '@/components/header/loginRlist.vue'
// import  afterLogin from '@/components/header/afterLogin.vue'



// gong
// import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import LotDetails from '@/views/LotDetails.vue'
import lunboL from '@/components/luboL.vue'
import TimerFn from '@/components/TimerFn.vue'
import ButtomL from '@/views/ButtomL.vue'
import AAText from '@/views/AAText.vue';
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: 'special',
        name: 'special',
        component: () => import(/* webpackChunkName: "about" */ '../views/specialView.vue')
      },
      {
        path: '',
        name: 'sonHome',
        component: () => import(/* webpackChunkName: "about" */ '../views/sonHome.vue')
      },
      {
        path: 'online',
        name: 'online',
        component: () => import(/* webpackChunkName: "about" */ '../views/onlineAuction.vue'),
        children: [
          {
            path: '',
            name: 'bigImg',
            component: () => import(/* webpackChunkName: "about" */ '../views/bigImg.vue'),
          },
          {
            path: 'textView',
            name: 'textView',
            component: () => import(/* webpackChunkName: "about" */ '../views/textView.vue'),
          },
          {
            path: 'textImg',
            name: 'textImg',
            component: () => import(/* webpackChunkName: "about" */ '../views/textImg.vue'),
          }
        ]
      }
    ]
  },
   
  {
    path: '/text',
    component: AAText,
  },
  {
    path: '/loginRlist',
    component: loginRlist,
  },
  {
    path: '/personzl',
    component: personzl,
  },
  {
    path: '/phoneMessage',
    component: phoneMessage,
    meta: {
      title: '短信登录'
    }
  },
  {
    path: '/serectCode',
    component: serectCode,
    meta: {
      title: '修改密码'
    }
  },
  {
    path: '/loginWx',
    component: loginWx,
    meta: {
      title: '首页微信'
    }

  }
  , {
    path: '/passwdRet',
    component: passwdRet,
    meta: {
      title: '重置密码'
    }
  },


  {
    path: '/sell',
    name: 'sell',
    component: () => import(/* webpackChunkName: "about" */ '../views/sellGoods.vue')
  },


  {
    path: '/loginRlist',
    component: loginRlist,
  },
  {
    path: '/personzl',
    component: personzl,
  },
  {
    path: '/phoneMessage',
    component: phoneMessage,
    meta: {
      title: '短信登录'
    }
  },
  {
    path: '/serectCode',
    component: serectCode,
    meta: {
      title: '修改密码'
    }
  },
  {
    path: '/',
    component: HomeView,
    meta: {
      title: '首页'
    }
  },

  {
    path: '/loginWx',
    component: loginWx,
    meta: {
      title: '首页微信'
    }

  }
  , {
    path: '/passwdRet',
    component: passwdRet,
    meta: {
      title: '重置密码'
    }
  },




  
  {
    path: '/car',
    name: 'car',
    component: PersonCar
  },
  {
    path: '/toSettlement',
    component: PcommodityList
  },
  {
    path: '/order',
    name: 'order',
    component: PcommodityList
  },
  {
    path: '/payment',
    name: 'payment',
    component: commodityPayment
  },

  {
    path: '/personal',
    name: 'personal',
    component: PersonInfo,
    children: [
      {
        path: '',
        component: () => import('@/views/PersonalHomepage.vue')
      },

      {
        path: 'collections',
        name: 'collections',
        component: () => import('@/views/PersonalCollect.vue')
      },
      {
        path: 'buybook',
        name: 'buybook',
        component: PersonLot
      },
      {
        path: 'Auction',
        name: 'Auction',
        component: PersonLot
      },
      {
        path: 'personalData',
        name: 'personData',
        component: personData
      },
      {
        path: 'setPswd',
        component: serectCode,

      },

      {
        path: 'transaction',
        name: 'transaction',
        component: PersonLot
      },
      {
        path: 'Lot',
        name: 'lot',
        component: () => import('@/views/PersonLot.vue')
      },

      {
        path: 'subscribe',
        name: 'subscribe',
        component: PersonLot
      },
      {
        path: 'shop',
        name: 'shop',
        component: PersonLot
      },
      {
        path: 'address',
        name: 'address',
        component: PersonLot
      },
      {
        path: 'serectCode',
        component: serectCode,
        meta: {
          title: '修改密码'
        }
      },


    ]
  },






  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/ButtomL',
    name: 'ButtomL',
    component: ButtomL
  },
  // {
  //   path: '/detail',
  //   name: 'detail',
  //   component: LotDetails
  // },
  // 动态路由访问详情页
  {
    path: '/detail/:id',
    name: 'detail',
    component: LotDetails
  },
  {
    path: '/lunboL',
    name: 'lunboL',
    component: lunboL
  },
  {
    path: '/TimerFn',
    name: 'TimerFn',
    component: TimerFn
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
